import request from '../utils/request'

export function getArticle (title, type, pageSize, currentPage) {
  return request({
    url: 'app/article',
    method: 'get',
    params: {
      title: title,
      type: type,
      'page-size': pageSize,
      'current-page': currentPage
    }
  })
}

export function postArticle (data) {
  return request({
    url: 'app/article',
    method: 'post',
    data: data
  })
}

export function putArticle (data) {
  return request({
    url: 'app/article',
    method: 'put',
    data: data
  })
}

export function deleteArticle (id) {
  return request({
    url: 'app/article',
    method: 'delete',
    data: {
      id
    }
  })
}
